const logger = require("../../utils/logger");
function handParse(json) {
  try {
    return Object.assign({}, JSON.parse(json));
  } catch (error) {
    logger.error("handParse 解析错误", error);
    return null;
  }
}

const path = require("path");
const fs = require("fs");
function testLogFile(data) {
  // data 写入 t.json
  const rp = path.join(__dirname, "../../t.json");
  fs.writeFileSync(rp, JSON.stringify(data));
}

exports.handParse = handParse;
exports.testLogFile = testLogFile;
